package com.test.test11.entity;

import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * 存储用户设备关系
 */

public class UserDeviceRelationship {

    private String id;           // 关系id
    private Date updateTime;     // 最近一次更新时间
    private Device device;       // 设备
    private String rname;        // 设备名称
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Device getDevice() {
        System.out.println("111235123");
        return device;
    }

    public void setDevice(Device device) {
        this.device = device;
    }

    public String getRname() {
        return rname;
    }

    public void setRname(String rname) {
        this.rname = rname;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj!=null && obj instanceof UserDeviceRelationship){
            UserDeviceRelationship o = (UserDeviceRelationship)obj;
            if(StringUtils.isNotBlank(o.getId()) && o.getId().equals(this.id)){
                return true;
            }
        }
        return false;
    }
}
